package com.huawei.appmarket.service.store.awk.card;

import android.content.Context;
import android.view.View;
import com.huawei.appgallery.foundation.card.base.normal.bean.NormalCardBean;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appgallery.horizontalcard.api.bean.BaseHorizontalModuleCardBean;
import com.huawei.appmarket.service.store.awk.bean.BaseHorizontalCardBean;
import com.huawei.appmarket.service.store.awk.widget.horizon.BaseHorizonCard;
import java.util.ArrayList;
import java.util.List;
import o.azb;
import o.cgz;
import o.chc;
import o.dof;
import o.ebk;
import o.CollectCheck;
import o.ewm.j;

public class NormalHorizonCard extends BaseHorizonCard {
    private View ʽ;
    private ebk ॱॱ;

    public NormalHorizonCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        super.ˏ(view);
        this.ʽ = view.findViewById(j.ʼꞌ);
        int ˏॱ = ˏॱ();
        this.ˎ.setPadding(ˏॱ, this.ˎ.getPaddingTop(), ˏॱ, this.ˎ.getPaddingBottom());
        this.ॱॱ = new ebk();
        this.ॱॱ.ˎ(view);
        return this;
    }

    protected int ˏॱ() {
        return azb.ˊ(this.ʼॱ) - this.ᐝ.ˊ();
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        if (dof.ʽ(ᐝॱ().v_())) {
            this.ʿ.setVisibility(4);
        } else {
            this.ʿ.setVisibility(0);
            this.ʿ.setText(ᐝॱ().v_());
        }
        ˎ((BaseHorizontalModuleCardBean) (BaseHorizontalCardBean) cardBean);
        if (dof.ʽ(ᐝॱ().ॱॱ()) || !ˏ(this.ʿ.getContext(), ᐝॱ().ʻˋ())) {
            ʻॱ().setVisibility(8);
        } else {
            ʻॱ().setVisibility(0);
        }
        if (this.ॱॱ != null) {
            this.ॱॱ.ˋ(ᐝॱ());
            this.ॱॱ.ॱ(this.ॱ.ˏ());
            this.ॱॱ.ˊ(ˉ());
            this.ॱॱ.ˊ();
        }
    }

    protected boolean ˏ(Context context, List<NormalCardBean> list) {
        if (CollectCheck.isEmpty(list)) {
            return false;
        }
        if (ᐝॱ().ʻˋ().size() > ᐝॱ().ʼˊ() || ᐝॱ().ʾॱ() != 0) {
            return true;
        }
        return false;
    }

    public void ˎ() {
        this.ᐝ.ˏ((azb.ॱ(this.ʼॱ) - chc.ˏ()) - chc.ॱ());
        this.ᐝ.ˋ(chc.ˋ());
        this.ᐝ.ॱ(chc.ˋ());
    }

    public View ʻॱ() {
        return this.ʽ;
    }

    public ArrayList<String> ˊॱ() {
        if (this.ॱॱ == null) {
            return null;
        }
        return this.ॱॱ.ˋ();
    }

    public boolean ॱˊ() {
        if (this.ॱॱ == null || this.ॱॱ.ˎ() == null) {
            return false;
        }
        return true;
    }
}
